package cn.buk.tms.dto;

import cn.buk.tms.entity.base.City;
import org.springframework.beans.BeanUtils;

/**
 * 城市信息
 * @author yfdai
 */
public class CityDto {

    private int id;

    /**
     * 城市的三字代码
     */
    private String cityCode;

    private String cityName;

    private String cityEnglishName;

    private String countryCode;

    private String countryName;

    private Integer provinceId;

    private String provinceName;

    public static CityDto createdBy(City city) {
        CityDto cityDto = new CityDto();
        BeanUtils.copyProperties(city, cityDto);

        return cityDto;
    }

    public static City convertTo(CityDto dto) {
        City city = new City();
        BeanUtils.copyProperties(dto, city);

        return city;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getCityCode() {
        return cityCode;
    }

    public void setCityCode(String cityCode) {
        this.cityCode = cityCode;
    }

    public String getCityName() {
        return cityName;
    }

    public void setCityName(String cityName) {
        this.cityName = cityName;
    }

    public String getCityEnglishName() {
        return cityEnglishName;
    }

    public void setCityEnglishName(String cityEnglishName) {
        this.cityEnglishName = cityEnglishName;
    }

    public String getCountryCode() {
        return countryCode;
    }

    public void setCountryCode(String countryCode) {
        this.countryCode = countryCode;
    }

    public Integer getProvinceId() {
        return provinceId;
    }

    public void setProvinceId(Integer provinceId) {
        this.provinceId = provinceId;
    }

    public String getProvinceName() {
        return provinceName;
    }

    public void setProvinceName(String provinceName) {
        this.provinceName = provinceName;
    }

    public String getCountryName() {
        return countryName;
    }

    public void setCountryName(String countryName) {
        this.countryName = countryName;
    }
}
